<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/

  defined('_JEXEC') or die('Retricted Access');
  if (count($this->items)==0)
  {
	 echo JText::_("You have not any saved search yet")."<br />";
	 
  }
  else 
  {
?>
<script type="text/javascript">
/* <![CDATA[ */
	
    function tableOrdering( order, dir, task ) {        
		form.filter_order.value     = order;
        form.filter_order_Dir.value    = dir;
        form.task.value = task;
        form.submit();
    }
    
/* ]]> */
</script>
<form  name="adminForm" action="<?php echo JURI::root();?>index.php" method="post">
	    <div style="width:100%;">
			<table class="tablelist">
	        	<thead>
	            	<tr>
	            		<td class="sectiontableheader" width="5%"><?php echo JText::_( 'NUM' ); ?></td>
	            		<!--<th width="5%"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->items); ?>);" /></th>-->
	            		<td class="sectiontableheader" width="30%">            		
	            			<?php echo JHTML::_('grid.sort',   JText::_('Title'), 'title',@$this->lists['order_Dir'], @$this->lists['order']); ?>
	            		</td>            		
	            		<td class="sectiontableheader" width="20%"><?php echo JHTML::_('grid.sort',   JText::_('Keyword'), 'keyword',@$this->lists['order_Dir'], @$this->lists['order']); ?>
	            		<td class="sectiontableheader" width="20%"><?php echo JText::_('Category'); ?></td>
	            		<td class="sectiontableheader" width="15%"><?php echo JText::_('Location'); ?></td>
	            		
	            		<td class="sectiontableheader" width="10%">
	            			<?php echo JText::_("Action"); ?>
	            		</td>
	            	</tr>
				</thead>
				<tbody>
	        	<?php
	        	$items = $this->items;
	        	
	        	for($i = 0; $i < count($items); $i++){
	        		$item = $items[$i];
	        		JFilterOutput::objectHtmlSafe($item);
					?>
	        		<tr class="sectiontableentry<?php echo $i%2+1; ?>">
	            		<td width="5%"><?php echo $i+1;  ?></td>            		
	            		<td width="30%"><?php echo $item->title; ?></td>
	            		<td width="20%"><?php echo $item->keyword; ?></td>
	            		<td width="20%"><?php echo $item->category; ?></td>
	            		<td width="15%"><?php echo $item->location; ?></td>
	                    
	                    <td width="10%">
	                    	<span><a href="<?php echo JRoute::_("index.php?option=".$this->lists["option"]."&view=jajobalerts&layout=form&cid[]=$item->id&Itemid=1000"); ?>"><img src="<?php echo JURI::base()?>components/<?php echo $option;?>/images/icon_edit.png" title="<?php echo JText::_("Click here to edit")?>" alt="<?php echo JText::_('Edit')?>"/></a></span>
	                    	<span><a href="javascript:if (confirm('Do you want to delete?')) window.location='<?php echo JRoute::_("index.php?option=".$this->lists["option"]."&view=jajobalerts&layout=delete&cid[]=$item->id&Itemid=1000"); ?>'"><img src="<?php echo JURI::base()?>components/<?php echo $option;?>/images/icon_delete.gif" title="<?php echo JText::_("Click here to delte this item")?>" alt="<?php echo JText::_('Delete')?>"/></a></span>          	
							<span><a target="_blank" href="<?php echo JRoute::_("index.php?option=".$this->lists["option"]."&view=jajobs&layout=jobalert_result&cid[]=$item->id&Itemid=1000"); ?>"><img src="<?php echo JURI::base()?>components/<?php echo $option;?>/images/icon-search.gif" title="<?php echo JText::_("Click here to view result")?>" alt="<?php echo JText::_('Result')?>"/></a></span>
	                    </td>
	            	</tr>
	        	<?php
	        	
				}
	        	?>
	        	</tbody>
	        	<tfoot>
					<tr>
						<td colspan="6">
							<?php //echo $this->pagination->getListFooter(); ?>
						</td>
					</tr>
				</tfoot>
			</table>
		</div>
	</td>
	</tr>
	</table>
	
	<input type="hidden" name="option" value="<?php echo $this->lists['option']; ?>" />
	<input type="hidden" name="view" value="jajobalerts" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
	<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar("Itemid"); ?>" /> 
	<?php echo JHTML::_( 'form.token' ); ?>	
 </form>
<?php 
  } 
  echo '<a class="button" href="'.JRoute::_("index.php?option=".$this->lists["option"]."&view=jajobalerts&layout=form&Itemid=".JRequest::getVar("Itemid")).' ">'.JText::_("Create new").'</a>';
  ?>
